Method for carrying out a secured startup sequence of a control unit

ABSTRACT

A method for carrying out a secured startup sequence of a control unit, which includes a host that is configured to execute a loader program and one or multiple application programs, and a hardware security module (HSM) which includes a program memory and a data memory. The method includes a starting of the host and of the HSM; an authentication of the loader program by the HSM with the aid of a loader program signature stored in the program memory of the HSM; and, an execution of the loader program by the host if the authentication of the loader program is successful.

CROSS REFERENCE

The present application claims the benefit under 35 U.S.C. § 119 ofGerman Patent Application No. DE 102020207861.0 filed on Jun. 25, 2020,which is expressly incorporated herein by reference in its entirety.

FIELD

The present invention relates to a method for carrying out a securedstartup sequence of a control unit as well as to a processing unit andto a computer program for carrying out the method.

BACKGROUND INFORMATION

Programmable control units are used in machines and vehicles in order tocontrol the latter or also components thereof. For example, a vehiclemay contain control units for engine control, for the braking system,etc. The control units include a processor including one or, typicallyincluding multiple processor cores (also simply referred to as host orhost system), which execute programs stored in a memory in order toachieve the functions of the control unit.

For safety reasons, it may be provided that before a program is executedby the control unit, the authenticity of the program is checked, inorder to prevent a manipulated program from being executed. For thispurpose, it may be checked whether a memory area in which the program isstored is unchanged. This is carried out by a so-called hardwaresecurity module HSM, which provides functionalities in order to secureprograms executed by the control unit and communication frommanipulation. The HSM uses cryptological functions, signatures and(secret) keys for this purpose. The signatures and keys are stored bythe HSM in a data memory, which is initialized during the startup of thecontrol unit. Typically, the loader program of the host, which loads, inparticular, an application program, must initially be checked forauthenticity when starting the control unit. Delays may result in thiscase due to the necessary initialization of the data memory, which iscarried out by the HSM at a reduced clock frequency.

SUMMARY

According to the present invention, a method is provided for carryingout a secured startup sequence of a control unit as well as a processingunit and a computer program for carrying out the method. Advantageousexample embodiments of the present invention are disclosed herein.

In accordance with an example embodiment of the present invention,because a loader program signature is situated in the program memory ofthe HSM, which is protected by the HSM, i.e., secured againstmanipulations, and which may be accessed immediately with the startup ofthe HSM without having to wait for an initialization of the data memoryof the HSM, it is therefore possible even with a potentially furtherreduced clock frequency of the HSM to carry out a secured and faststartup sequence in a way that makes the securing of control units usedin time-critical applications (for example, engine control units)possible. The method for carrying out a secured startup sequence of acontrol unit is, in other words, a secured control unit startupsequence.

The term “startup sequence” or startup refers in this case to stepscarried out by the control unit initially after the startup untilapplication programs, which implement the actual control functionalityof the control unit, are up and running. “Secured” is intended to meanthat it is not possible to manipulate the startup sequence in such a waythat programs are executed, which change the functionality of thecontrol unit in an unauthorized manner, i.e., change in a manner notauthorized by the manufacturer and/or user of the device (for example,machine or vehicle), in which the control unit is used, or which enablean attacker to acquire control of the control unit and thus at leastpartially of the device controlled by this control unit. The loaderprogram signature constitutes a reference signature for the loaderprogram.

In accordance with an example embodiment of the present invention, thehost or the host system includes a processor (host core), which isconfigured to execute software or computer programs (referred to simplyas programs), in order to implement functions of the control unit. Thehost may include further elements such as, for example, a (volatile)working memory (for example, a direct access memory, random accessmemory, RAM), a non-volatile host memory (for example, a flash memory),communication interfaces, in particular, for communication with the hostmemory, with the HSM and with external devices and/or the like. Softwareis contained or stored in the host memory, which is non-volatile, forexample, in a flash memory, a hard disk or an SSD (solid state disk).The host memory is re-writable.

The programs may include one or multiple application programs, which areconfigured to implement control functions of the control unit when theyare carried out by the host, a loader program, which is configured tocarry out initializations and to call up at least one of the applicationprograms when it is executed by the host, and an update program(programming software), which is configured to, among other things,rewrite the host memory or parts thereof with software (program data) ordata when it is executed by the host. With the aid of the updateprogram, which basically represents a programming software forreprogramming the control unit, it is possible to update or re-programthe control unit. The update may relate to programs, whose sequencedetermines the function of the control unit, and/or data, which arerequired for the function of the control unit, for example, initializingparameters or program parameters. When updating or re-programming, thehost memory or areas thereof are entirely or partially rewritten withupdate data (new programs, i.e., software, and/or other new data). Theupdate program may optionally, if necessary, carry out further actions,for example, determining which programs/data must be updated, or prompta restart of the control unit after the update.

In accordance with an example embodiment of the present invention, thehardware security module, referred to in short as HSM, includes aprocessor (HSM core) and an HSM memory, which includes a program memoryand a data memory. The HSM provides cryptographic functions, which maybe utilized by the host in order to secure safety critical functions,for example, the communication of multiple control units among oneanother. For this purpose, the HSM maintains, in particular, secretpasswords (code words), cryptographic keys and/or signatures andimplements cryptographic methods preferably in hardware. Thesepasswords, keys and/or signatures are stored by the HSM. The host coremay be designed separately from the host or may be integrated with thehost or with the host processor and the memory in one chip (HSM and hostare then formed, for example, by various processor cores on the chip).The HSM is configured, in particular, to check the integrity of memoryareas of the host memory in order to check the authenticity of computerprograms contained in the respective memory area or of software and/ordata contained therein.

In accordance with an example embodiment of the present invention, inthe integrity check, it is determined whether the content of the memoryarea (of the host memory) to be checked is unchanged compared to acontent known to be correct. This takes place preferably by a comparisonof signatures, a signature maintained by the HSM and stored in the HSMmemory (i.e., a reference signature), which corresponds to an (earlier)state of the memory area, about which it is known that this memory areais correct (not manipulated), being compared with a newly calculatedvalue of the signature, which is calculated based on the instantaneouscontent of the memory area. If the newly calculated signature value isidentical to the stored signature (reference signature), then thecontent of the memory area (in terms of the signature comparison) isunchanged, the authenticity of the program is then confirmed. If, on theother hand, the newly calculated signature value is not identical to thestored signature (reference signature), then the content of the memoryarea (in terms of the signature comparison) is changed, the authenticityof the program is then not confirmed.

For example, a check value or a hash value of the data stored in thememory area may be calculated and may be compared to a value calculatedat an earlier point in time, at which it was known that the memory areacontained correct, non-manipulated software and/or data. A matching of aMAC, i.e. a message authentication code, preferably takes place for theintegrity check. A secret key, which is administered by the HSM, isincorporated in the calculation of a MAC in addition to the originalmessage, in this case, the data stored in the memory area, or a hashvalue thereof. In this way, so-called collision attacks (or, in thiscase, pre-image attacks) may be prevented. A so-called CMAC(cipher-based message authentication code) is preferably used. Thesecited methods (check value, hash value, MAC, CMAC) represent preferredexamples of possible signature methods, however, another conventionalmethod may also be used, for example, conventional digital signatures.

In accordance with an example embodiment of the present invention, themethod may include preferably initializing the data memory of the HSMafter the authentication of the loader program. The method may furtherpreferably include an increase of a clock frequency of the HSM after theinitialization. These steps enable the quick access to applicationprogram signatures stored in the data memory of the HSM and to otherdata stored there (e.g., passwords, etc.).

In accordance with an example embodiment of the present invention, themethod further includes, subsequent to the execution of the loaderprogram, preferably an authentication of at least one of the one or ofthe multiple application programs with the aid of at least oneapplication program signature stored in the data memory of the HSM; and,if the authentication of the at least one application program issuccessful, an execution of the at least one application program by thehost. In this way, the execution of manipulated application programs isprevented.

In accordance with an example embodiment of the present invention, themethod may preferably include, if the at least one application programis an update program for the loader program of the host, an updating ofthe loader program by the update program; a determination or calculationof a changed loader program signature of the updated loader program ofthe host; a writing of the changed loader program signature into theprogram memory of the HSM; and, preferably a restart of the controlunit. If, during the update, for example, a new version of the loaderprogram is installed, it is thereby ensured that this new version may becorrectly authenticated.

The authentication of the loader program and/or of the at least oneapplication program may preferably include a calculation of a signature,in particular of a digital signature or of a message authenticationcode, MAC, of a memory area, in which the loader program or the at leastone application program is stored, and a comparison of the calculatedsignature with the loader program signature or application programsignature, the authentication being defined as successful if thecalculated signature is identical to the loader program signature orapplication program signature, and the authentication being defined asunsuccessful if the calculated signature is not identical to the loaderprogram signature or application program signature. When using asignature comparison for authenticating programs, the reliability of theauthentication is ultimately a function of the strength of the signaturemethod against attacks. Thus, a high degree of manipulation safety maybe ensured by the selection of an appropriate signature method.

In accordance with an example embodiment of the present invention, themethod may preferably include stopping the control unit and/or sendingor outputting an error message if the authentication of the loaderprogram and/or of the at least one application program is unsuccessful.This may prevent a potentially manipulated control unit from runningfurther and from potentially erroneously executing safety-criticalfunctions. The error message may be output to a user. It is equallypossible to forward the error message to one or to multiple othercontrol units. For example, motor vehicles include a multitude ofcontrol units; if one of these, for example, a control unit for thebraking system, establishes with the aid of a failed authentication apossible manipulation attempt, this control unit may output or send acorresponding error message to other control units, so that theserespond thereto, for example, are unable to start or stop; for example,an engine control unit could stop the engine if the control unit of thebraking system reports a potential manipulation attempt.

In accordance with an example embodiment of the present invention, themethod may include preferably a writing of the loader program signatureinto the program memory of the HSM. This takes place (apart from theabove-described update method), in particular, during an initialinitialization or programming of the control unit in secure surroundings(for example, during the production of the control unit or duringinstallation of the control unit into a machine or a motor vehicle). Inthis way, it is possible to ensure a loader program signature consistentwith the originally uploaded loader program.

A processing unit according to the present invention, for example, acontrol unit of a motor vehicle is, in particular, programmaticallyconfigured to carry out a method according to the present invention.

The implementation of a method according to example embodiments of thepresent invention in the form of a computer program or computer programproduct including program code for carrying out all method steps is alsoadvantageous, since this generates particularly low costs, inparticular, if an executing control unit is also utilized for furthertasks and is therefore already present. Suitable data media forproviding the computer program are, in particular, magnetic, optical andelectrical memories such as, for example, hard disks, flash memories,EEPROMs, DVDs and the like. A download of a program via computernetworks (Internet, Intranet, etc.) is also possible.

Further advantages and embodiments of the present invention result fromthe description herein and the figures.

The present invention is schematically represented in the drawings basedon exemplary embodiments and is described below with reference to thefigures.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows the basic setup of a control unit on which the presentinvention may be based, in accordance with an example embodiment of thepresent invention.

FIG. 2 shows an overview of the basic structure of one preferredspecific embodiment of the method for carrying out a secured startupsequence of a control unit, in accordance with the present invention.

FIG. 3 shows a flowchart of one preferred specific embodiment of themethod according to the present invention.

DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS

FIG. 1 shows the basic setup of a control unit or of a processing unitcontained in a control unit, on which the present invention may bebased. In this case, essentially only those components are shown, whichare necessary for understanding the present invention.

Control unit 1 includes a host 2 and a hardware security module (HSM) 4.These are interconnected with the aid of one or of multiple connectionsor lines 3 for exchanging data. It may also be a serial or parallelconnection. The connection may be a point-to-point connection or mayalso be implemented via a bus.

Host 2 includes a host core 6, i.e., a processor, and a host memory 8,in which programs, in particular, a loader program and applicationprograms, and data are stored. Host core 2 is configured to executeprograms stored in host memory 8.

HSM 4 includes an HSM core 10, i.e., a processor, a program memory 12for programs to be executed by the HSM core, and a data memory 14, inparticular, for signatures and keys. In program memory 12, a memory area16 is provided, in which a signature (or reference signature) for theloader program of the host (referred to as loader program signature) isstored. Program memory 12 and data memory 14 differ insofar as programmemory 12 may be accessed immediately with the start of HSM 10, whereasdata memory 14 must first be initialized. Thus, the data memory in thiscase has slower access times.

For the sake of completeness, a communication interface 18 is alsoshown, which serves to connect control unit 1 to other devices. Thesemay be, in particular a device to be controlled by the control unitand/or other control units. A programming device, with which an updateof the control device is to be carried out, may also communicate withthe control unit via communication interface 18. In addition to otherinterfaces, communication interface 18 may include a CAN bus interface,for example. Communication interface 18 in this case is directlyconnected to host 2, but may, for example, also be connected via a bus.

Multiple or also all of the individual parts (host 2, HSM 4, memories 8,12, 14, communication interface 18) may be integrated in one chip.Contrary to that shown, memories 8, 12, 14 may also be implementedseparately (separate chip) from each core. The three memories (hostmemory 8, program memory 12 of the HSM and data memory 14 of the HSM)may also be at least partially integrated with one another. A sharedmemory, in particular a flash memory, is typically provided, in whichvarious memory areas are provided for host memory 8, program memory 12of the HSM and data memory 14 of the HSM. The memory areas correspondingto program memory 12 and data memory 14 of the HSM are then reserved byhardware mechanisms for the HSM, the host is thus unable to access them.The shared memory may be connected to the host core and to the HSM corevia individual connections or via a bus. The shared memory may (forexample, as a flash bank) be integrated together with the host core andthe HSM core in one chip. The control unit may include furthercomponents not shown.

An overview of the basic structure of one preferred embodiment of themethod for carrying out a secured startup sequence of a control unit isshown in FIG. 2. Processes are shown to the left in the figure, whichrun on host side 22 and processes are shown to the right in the figure,which run on HSM side 24. Arrows represent relationships or interactionsbetween individual elements, i.e., in general not the temporal sequenceof successive steps in the manner of a flowchart. The arrangement of theelements drawn in the vertical direction of the figure roughlycorresponds to the temporal sequence, however, this arrangement does notnecessarily correspond exactly to the actual temporal sequence, i.e., itis possible that processes situated at identical vertical heights takeplace at different points in time, or processes situated at differentheights proceed simultaneously or in reverse sequence, as long as thisis consistent with the logical sequence of the method.

The host is initially started by starting up or switching on the controlunit in step 26 and the HSM is started in step 28. In the process, afirmware is typically executed by the host, which carries out orprovides basic initializations and functions. A loader program 30 of thehost is then called up by the firmware, which may carry out the furtherinitializations (for example, those relating to a specific use of thecontrol unit) and loads one (or multiple) application programs, i.e., asoftware, which implements the actual control function of the controlunit.

Loader program 30 is not immediately executed, however, rather theexecution is prevented until it is unblocked by the HSM, which initiallychecks the authenticity of the loader program. This may occur bychecking the integrity of the memory area in which the loader program isstored, i.e., it is checked whether the memory area has been changed inan unauthorized manner.

For this purpose, an associated value of a signature, for example, of adigital signature or a message authentication code, is initiallycalculated in step 32 based on the data in this memory area. Thissignature value, which is based on the instantaneous content of thememory area, is compared in step 34 with a loader program signature,which has been calculated at an earlier point in time at which thecontent of the memory area was known not to be manipulated. The loaderprogram signature that is used for comparison is stored in the programmemory of the HSM, so that this signature may still be read out beforeinitialization of the data memory of the HSM. The sequence thereforeincludes the step of reading out not further shown of the loader programsignature from the program memory of the HSM. The authentication of theloader program may therefore be immediately carried out even atinitially reduced clock frequency of the HSM and the startup sequence ofthe control unit may accordingly be run through quickly.

If the authenticity of the loader program is confirmed by the comparisonin step 34, i.e., if the instantaneously calculated signature value isidentical to the stored loader program signature, the execution of theloader program is authorized and the loader program is executed in step36. The loader program prompts the release to the HSM to continue withits further start process, in particular, using an initialization of theHSM data memory, which is carried out in step 38.

The loader program further loads at least one application program 40,which is preferably not immediately executed by the host, but only aftera successful authentication check by the HSM. In this case, theprocedure is similar to the authentication check of the loader program.An associated signature value (such as above, for example, the value ofa digital signature or of a message authentication code) is initiallycalculated in step 42 based on the content (i.e., on the program data)of a memory area, in which the application program is stored, and thissignature value is then compared in step 44 with a previously calculatedapplication program signature, which is associated with a previous stateof the content of the memory area known to be correct. If theinstantaneously calculated signature value is identical to thepreviously calculated application program signature, the execution ofthe application program is unblocked and this application program isexecuted in step 46. The application program signatures—in general,multiple application programs are present, which are either loaded orcalled up by the loader program during the control unit startup or arecalled up later by other application programs—are stored in the datamemory of the HSM, which is now initialized and which may becorrespondingly quickly accessed. Alternatively, further referencesignatures may also be loaded into the HSM-RAM (i.e., into the volatileworking memory of the HSM) immediately after the initialization of theHSM data memory.

FIG. 3 represents a flowchart of one preferred specific embodiment ofthe method according to the present invention. The secured control unitstartup sequence begins, in principle, with step 52, the start of thehost and of the HSM, the host core and the HSM core, in particular,being started. A previous step 50 is additionally shown, in which aloader program signature, i.e., a cryptographic reference signature withwhich the authenticity of the loader program may be checked, iscalculated and is stored in the program memory of the HSM. Such acryptographic signature may, for example, be provided by a digitalsignature or by a message authentication code (MAC). The calculation isbased on the memory area in which the loader program is contained or isstored. In the process, a signature is calculated from the loaderprogram data contained in this memory area. The value of the signaturecalculated at the reference point in time, which corresponds to acorrect state, i.e., non-manipulated state, of the memory area, is theloader program signature (i.e., the loader program reference signature),on the basis of which the integrity of the memory area may be checked.This step 50 is carried out, for example, during the manufacture of thecontrol unit or of the initial programming of the control unit.

In step 54, the signature value is recalculated, based on theinstantaneous, i.e., at the start point in time, content of the memoryarea of the loader program. This (re)calculated signature value iscompared in step 56 with the loader program signature stored in theprogram memory of the HSM in order to check the integrity of the memoryarea, i.e., to check whether the memory area and, therefore, the loaderprogram is unchanged. For this purpose, the loader program signature isread out from the program memory of the HSM in a step not further shown.These calculations and the comparison may be carried out by the HSM.

If the calculated signature value and the loader program signature arenot identical, the check of the authenticity of the loader program isunsuccessful, arrow 58. In this case, the control unit is stopped and/oran error message is sent (for example, to other control units) or output(for example, on a display device of the control unit) in step 60.

If the calculated signature value and the loader program signature areidentical, the check of the authenticity of the loader program issuccessful, arrow 62. In this case, the loader program is executed instep 64. The loader program carries out, for example, a more extensiveinitialization of the control unit. The loader program may, inparticular, prompt an initialization of the data memory, which iscarried out in step 66. After initialization, an increase in the clockfrequency of the HSM, in particular, of the HSM core is preferablyprovided in step 68. The loader program loads at least one applicationprogram preferably at the end of the startup sequence, via the executionof which at least one control function of the control unit isimplemented.

The authenticity of the (at least one) application program isadvantageously checked by the HSM before being executed. For thispurpose, a signature value is calculated in step 70 based on the memoryarea in which the application program is stored. The signature value iscompared in step 72 with a previously calculated application programsignature stored in the data memory of the HSM, the application programsignature thus being based on a state of the memory area of theapplications program known to be non-manipulated. One of the methodsmentioned above in conjunction with the loader program signature mayagain be used in the calculation of signature value and applicationprogram signature.

If the calculated signature value and the application program signatureare not identical, the check of the authenticity of the applicationprogram is unsuccessful, arrow 74. In this case, the control unit isstopped and/or an error message is sent (for example to other controlunits) or output (for example, on a display device of the control unit)in step 60.

If the calculated signature value and the application program signatureare identical, the check of the authenticity of the application programis successful, arrow 76. In this case, it is checked in step 78 whetheran update of the loader program is to be carried out.

If no update of the loader program is to be carried out, arrow 80, theexecution of the application program is continued, step 82. It should benoted here that this application program may also be an update programfor an application program, in contrast to an update program for theloader program. The latter case is explicitly carried out here, since itis connected to the secured control unit startup sequence.

If an update of the control unit is to be carried out, arrow 84, in step86 an update program (which has been authenticated in steps 70, 72,where it is still referred to as application program) is carried out forthe loader program, this program overwrites the memory area in which theloader program is stored, at least partially with update data, forexample, of a new version of the loader program. The loader programsignature is subsequently recalculated in step 90 based on the rewrittenmemory area. In step 92, the recalculated loader program signature isstored in the program memory of the HSM instead of the previouslyapplicable loader program memory. The execution of an applicationprogram, step 82, (which is to be authenticated, if necessary, beforeexecution) or, if necessary, a restart of the starting device, notshown, may be subsequently continued.

1-11. (canceled)
 12. A method for carrying out a secured startupsequence of a control unit, which includes a host that is configured toexecute a loader program and one or multiple application programs, and ahardware security module (HSM) which includes a program memory and adata memory, the method comprising the following steps: starting thehost and the HSM; authenticating the loader program by the HSM using aloader program signature stored in the program memory of the HSM; andexecuting the loader program by the host when the authentication of theloader program is successful.
 13. The method as recited in claim 12,further comprising: initializing the data memory of the HSM afterauthentication of the loader program.
 14. The method as recited in claim13, further comprising: increasing a clock frequency of the HSM afterthe initialization of the data memory of the HSM.
 15. The method asrecited in claim 12, further comprising performing, after execution ofthe loader program: authenticating at least one application program ofthe one or of the multiple application programs by the HSM using atleast one application program signature stored in the data memory of theHSM; and executing the at least one application program by the host whenthe authentication of the at least one application program issuccessful.
 16. The method as recited in claim 15, wherein the methodfurther comprises performing, when the at least one application programis an update program for the loader program of the host: updating theloader program by the update program; determining a changed loaderprogram signature of the updated loader program of the host; writing thechanged loader program signature into the program memory of the HSM; andrestarting the control unit.
 17. The method as recited in claim 12,wherein the authentication of the loader program includes: calculating asignature of a memory area in which the loader program is stored, thesignature including a digital signature or a message authentication code(MAC); and comparing the calculated signature with the loader programsignature; wherein the authentication is successful when the calculatedsignature is identical to the loader program signature, and theauthentication being defined as unsuccessful when the calculatedsignature is not identical to the loader program signature.
 18. Themethod as recited in claim 15, wherein the authentication of the atleast one application program includes: calculating a signature of amemory area in which the at least one application program is stored, thesignature including a digital signature or a message authentication code(MAC); and comparing the calculated signature with the applicationprogram signature; wherein the authentication is successful when thecalculated signature is identical to the application program signature,and the authentication being defined as unsuccessful when the calculatedsignature is not identical to the application program signature.
 19. Themethod as recited in claim 12, further comprising: when theauthentication of the loader program is unsuccessful: stopping thecontrol unit and/or sending or outputting an error message.
 20. Themethod as recited in claim 12, further comprising: writing the loaderprogram signature into the program memory of the HSM.
 21. A processingunit, comprising: a host configured to execute a loader program and oneor multiple application programs; and a hardware security module (HSM)which includes a program memory and a data memory; wherein theprocessing unit is configured to: starting the host and the HSM;authenticate the loader program by the HSM using a loader programsignature stored in the program memory of the HSM; and execute theloader program by the host when the authentication of the loader programis successful.
 22. A non-transitory machine-readable memory medium onwhich is stored a computer program for carrying out a secured startupsequence of a processing unit, processing unit including a host that isconfigured to execute a loader program and one or multiple applicationprograms, and a hardware security module (HSM) which includes a programmemory and a data memory, the computer program, when executed by theprocessing unit, causing the processing unit to perform the followingsteps: starting the host and the HSM; authenticating the loader programby the HSM using a loader program signature stored in the program memoryof the HSM; and executing the loader program by the host when theauthentication of the loader program is successful.